package xyz.chenyongpeng.orderconsumerdubbo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xyz.chenyongpeng.entity.ZsOrder;
import xyz.chenyongpeng.service.IZsOrderService;
import com.github.wxpay.sdk.WXPayConstants.SignType;

import java.util.Map;

@Service
public class OrderService {

    @Autowired
    private IZsOrderService zsOrderService;

    public ZsOrder find(String order_sn,String u_id){
        return zsOrderService.getOne(new QueryWrapper<ZsOrder>().eq("order_sn", order_sn)
        .eq("u_id", u_id));
    }

    public void delOneOrder(ZsOrder zsOrder){
        zsOrder.setIsDelete(1);
        zsOrderService.updateById(zsOrder);
    }

    public ZsOrder getOneByOrderSn(String order_sn){
        return zsOrderService.getOne(new QueryWrapper<ZsOrder>().eq("order_sn", order_sn));
    }

}
